package com.yc.cloud.openai.dto.request.coze;

import javax.validation.constraints.NotEmpty;

import com.yc.cloud.basic.enums.EnumValue;
import com.yc.cloud.openai.enums.CozeGrantTypeEnums;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class CozeOauthTokenParam {
    /**
     * 授权码
     */
    @Schema(description = "授权码,当grantType为authorization_code时,需要传入授权码")
    private String code;

    // /**
    // * JWT Token
    // */
    // @Schema(description = "JWT
    // Token,当grantType为urn:ietf:params:oauth:grant-type:jwt-bearer时,需要传入")
    // private String assertion;

    /**
     * 授权类型
     */
    @Schema(description = "授权类型,支持authorization_code,refresh_token,jwt", required = true)
    @EnumValue(enumClass = CozeGrantTypeEnums.class, message = "授权类型不支持")
    @NotEmpty(message = "授权类型不能为空")
    private String grantType;

    /**
     * 刷新令牌
     */
    @Schema(description = "刷新令牌,当grantType为refresh_token时,需要传入刷新令牌")
    private String refreshToken;

    /**
     * 用户名
     */
    @Schema(description = "用户名,当grantType为jwt时,需要传入用户名", hidden = true)
    private String username;
}
